﻿<controls:ChildWindow 
    x:Class="AdventureWorksApp.Views.EmployeeRegistrationWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
    xmlns:dataForm="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.DataForm.Toolkit"
    Width="400" Height="300" 
    Title="EmployeeRegistrationWindow" Closed="ChildWindow_Closed">
    <Grid x:Name="LayoutRoot" Margin="2">
        
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <dataForm:DataForm 
            x:Name="addEmployeeDataForm" 
            AutoGenerateFields="False" AutoCommit="True" AutoEdit="True" 
            CommandButtonsVisibility="None">
            <dataForm:DataForm.EditTemplate>
                <DataTemplate>
                    <StackPanel>
                        <dataForm:DataField Label="Login ID">
                            <TextBox Text="{Binding LoginID, Mode=TwoWay}" />
                        </dataForm:DataField>
                        <dataForm:DataField Label="National ID">
                            <TextBox Text="{Binding NationalIDNumber, Mode=TwoWay}" />
                        </dataForm:DataField>
                        <dataForm:DataField Label="Title">
                            <TextBox Text="{Binding Title, Mode=TwoWay}" />
                        </dataForm:DataField>
                        <dataForm:DataField Label="Job Title">
                            <TextBox Text="{Binding JobTitle, Mode=TwoWay}" />
                        </dataForm:DataField>
                        <dataForm:DataField Label="Marital Status">
                            <TextBox Text="{Binding MaritalStatus, Mode=TwoWay}" />
                        </dataForm:DataField>
                        <dataForm:DataField Label="Gender">
                            <TextBox Text="{Binding Gender, Mode=TwoWay,NotifyOnValidationError=True,  ValidatesOnExceptions=True }" />
                        </dataForm:DataField>
                        <dataForm:DataField Label="Salaried">
                            <CheckBox IsChecked="{Binding SalariedFlag, Mode=TwoWay,NotifyOnValidationError=True,  ValidatesOnExceptions=True }" />
                        </dataForm:DataField>
                        <dataForm:DataField Label="Active">
                            <CheckBox IsChecked="{Binding CurrentFlag, Mode=TwoWay,NotifyOnValidationError=True,  ValidatesOnExceptions=True }" />
                        </dataForm:DataField>
                    </StackPanel>
                </DataTemplate>
            </dataForm:DataForm.EditTemplate>
        </dataForm:DataForm>

        <Button x:Name="CancelButton" Content="Отмена" Click="CancelButton_Click" Width="75" Height="23" HorizontalAlignment="Right" Margin="0,12,0,0" Grid.Row="1" />
        <Button x:Name="OKButton" Content="ОК" Click="OKButton_Click" Width="75" Height="23" HorizontalAlignment="Right" Margin="0,12,79,0" Grid.Row="1" />
        
        
    </Grid>
</controls:ChildWindow>